﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Diagnostics;

namespace StarfleetCommanderDomain.Game
{
	public enum Ships
	{
		Hermes,
		Atlas,
		
	}

    [DebuggerDisplay("\\{ Name = {Name}, Count = {Count}, IsDefense = {IsDefense} \\}")]
    public sealed class CombatUnitModel : IEquatable<CombatUnitModel>
    {
        private readonly string _Name;
        private readonly int _Count;
        private readonly bool _IsDefense;

        public CombatUnitModel(string name, int count, bool isDefense)
        {
            _Name = name;
            _Count = count;
            _IsDefense = isDefense;
        }

        public override bool Equals(object obj)
        {
            if (obj is CombatUnitModel)
                return Equals((CombatUnitModel)obj);
            return false;
        }
        public bool Equals(CombatUnitModel obj)
        {
            if (obj == null)
                return false;
            if (!EqualityComparer<string>.Default.Equals(_Name, obj._Name))
                return false;
            if (!EqualityComparer<int>.Default.Equals(_Count, obj._Count))
                return false;
            if (!EqualityComparer<bool>.Default.Equals(_IsDefense, obj._IsDefense))
                return false;
            return true;
        }
        public override int GetHashCode()
        {
            int hash = 0;
            hash ^= EqualityComparer<string>.Default.GetHashCode(_Name);
            hash ^= EqualityComparer<int>.Default.GetHashCode(_Count);
            hash ^= EqualityComparer<bool>.Default.GetHashCode(_IsDefense);
            return hash;
        }
        public override string ToString()
        {
            return String.Format("{{ Name = {0}, Count = {1}, IsDefense = {2} }}", _Name, _Count, _IsDefense);
        }

        public string Name
        {
            get
            {
                return _Name;
            }
        }
        public int Count
        {
            get
            {
                return _Count;
            }
        }
        public bool IsDefense
        {
            get
            {
                return _IsDefense;
            }
        }
    }
           
}